<%@ page language="java" import="com.ruohi.manage.*,java.util.*,java.sql.*,com.ruohi.util.dbutil.*,com.ruohi.util.common.*" pageEncoding="UTF-8"%>
<%
	Connection connection = null;
	String tablePrefix = Env.getInstance().getProperty("table_prefix");
	DBHelper dbHelper = DBHelper.getInstance();
	Map model = new HashMap();
	String tableName = " gift_member_payoff ";
	try{
		Map typeMap = new LinkedHashMap();
		typeMap.put("","-请选择类型-");
		typeMap.putAll(CommonApplication.getEnumChildren("201",application));
		Map isMap = new HashMap();
		isMap.put("1","正常");
		isMap.put("0","禁用");
		
		Map applyMap = new LinkedHashMap();
		applyMap.put("1","申请中");
		applyMap.put("2","未通过");
		applyMap.put("100","已提现");
		
		connection = PoolManager.getConnection(DBType.getDBTypeByEnum("106013"));
		String id = CommonString.getFormatPara(request.getParameter("id"));
		String channelUUID = CommonString.getFormatPara(request.getParameter("channel_uuid"));
		if(null!=id&&!"".equals(id)){
			model = dbHelper.getMap(" select p.*,m.ali_pay,m.p_flag,m.real_name,m.cid_number,m.own_url from gift_member_payoff p left join gift_member m on p.mem_no=m.mem_no  where p.uuid = ? ",new Object [] {id} , connection);
		}
		if("".equals(channelUUID)&&null!=model){
			channelUUID = (String)model.get("channel_uuid");
		}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><%=Env.getInstance().getProperty("project_name") %></title>
<link href="/plugin/ui/ligerUI/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="/plugin/ui/ligerUI/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
<link href="/plugin/ui/ligerUI/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<link href="/backend/style/style.css" rel="stylesheet" type="text/css" />
<script src="/plugin/jquery/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="/plugin/editor/ueditor/editor_config.js"></script>
<script type="text/javascript" charset="utf-8" src="/plugin/editor/ueditor/editor_all_min.js"></script>
<script type="text/javascript" src="/plugin/area/city/citys.js"></script>
<link rel="stylesheet" type="text/css" href="/plugin/editor/ueditor/themes/default/ueditor.css"/>
<style type="text/css">
	.formRight { width:250px; text-align:left; }
</style>
</head>

<body style="margin: 0;padding: 0; overflow-x: hidden; overflow-y: auto; ">
<form name="theform" id="theform" action="/backend/action/crud.jsp?enumNo=106013">
  <div class="formDiv">
  	<div class="group">
		<span><img src="/plugin/ui/ligerUI/ligerUI/skins/icons/communication.gif" /></span>
		<span class="groupTitle">用户信息</span>
	</div>
    <div class="formLeft">用<span class="span3"></span>户<span class="span3"></span>名</div>
    <div class="formRight">
      <input type="text" style="width:120px;" class="jr_text" value="<%=CommonString.getFormatPara(model.get("mem_no")) %>" readonly="readonly" />
    </div>
    <div class="formLeft">合伙人类型</div>
    <div class="formRight">
      <select class="select" readonly="readonly">
      	<%=CommonForm.createSelect(typeMap,CommonString.getFormatPara(model.get("p_flag"))) %>
      </select>
    </div>
    <div style="clear:left;"></div>
    <div class="formLeft">真实姓名</div>
    <div class="formRight">
      <input type="text" class="jr_text" value="<%=CommonString.getFormatPara(model.get("real_name")) %>" readonly="readonly" />
    </div>
    <div class="formLeft">身份证号</div>
    <div class="formRight">
      <input type="text" class="jr_text" value="<%=CommonString.getFormatPara(model.get("cid_number")) %>" readonly="readonly" />
    </div>
    <div style="clear:left;"></div>
    <div class="formLeft">专属链接</div>
    <div class="formRight">
      <input type="text" class="jr_text" value="<%=CommonString.getFormatPara(model.get("own_url")) %>" readonly="readonly" />
    </div>
    <div class="formLeft">支付宝账号</div>
    <div class="formRight">
      <input type="text" class="jr_text" value="<%=CommonString.getFormatPara(model.get("ali_pay")) %>" readonly="readonly" />
    </div>
    <div style="clear:left;"></div>
    <div class="formLeft">银行卡账号</div>
    <div class="formRight">
      <input type="text" class="jr_text" value="<%=CommonString.getFormatPara(model.get("bank_num")) %>" readonly="readonly" />
    </div>
	
    <div class="group">
		<span><img src="/plugin/ui/ligerUI/ligerUI/skins/icons/communication.gif" /></span>
		<span class="groupTitle">提现信息（<font color="#ff0000">*</font>为必填项）</span>
	</div>
	<div class="formLeft">提现金额</div>
    <div class="formRight">
      <input type="text"  class="jr_text" style="width:100px;" value="<%=CommonString.getFormatPara(model.get("payoff")) %>" readonly="readonly" />元
    </div>
    <div style="clear:left;"></div>
    <div class="formLeft">处理状态</div>
    <div class="formRight"> 
    <select class="select" id="zd_order_status" name="zd_order_status" dataType='Require' msg='请选择处理状态！'>
    <%=CommonForm.createSelect(applyMap,CommonString.getFormatPara(model.get("order_status"))) %>
    </select> 
    </div>
    <div style="clear:left;"></div>
    <div class="formLeft">备注</div>
    <div class="formRight" style="width:620px;">
      <input type="text" class="jr_text" id="zd_remarks" name="zd_remarks" value="<%=CommonString.getFormatPara(model.get("remarks")) %>" />
    </div>
  </div>
  <div style="clear: left;"></div>
  <input type="hidden" name="zd_member_order_no" id="zd_member_order_no" value="<%=CommonString.getFormatPara(model.get("member_order_no")) %>" />
  <input type="hidden" name="zd_partner_order_no" id="zd_partner_order_no" value="<%=CommonString.getFormatPara(model.get("partner_order_no")) %>" />
  <input type="hidden" name="tableName" id="tableName" value="<%=tableName %>" />
  <input type="hidden" name="zd_id" id="zd_id" value="<%=CommonString.getFormatPara(model.get("id")) %>" />
  <input type="hidden" name="zd_channel_uuid" id="zd_channel_uuid" value="<%=channelUUID %>" />
  <input type="hidden" name="eventAfter" id="eventAfter" value="updatePayoffOrder" />
</form>
</body>
</html>
<script type="text/javascript" src="/plugin/jquery/jquery.form.js"></script>
<script src="/plugin/ui/ligerUI/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script src="/plugin/date/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="/backend/scripts/common.js" prefix="<%=tablePrefix %>" type="text/javascript"></script>
<script src="/plugin/validator/wofoshan/validator.min.js" type="text/javascript"></script>
<script type="text/javascript">
	function checkUserUnique(){
		var mem_no=$.trim($("#zd_mem_no").val());
		if(mem_no==""){
			alert("请输入用户名！");
			return;
		}
		
			$.ajax({
				type:"post",
				url:"/backend/action/ajax_r.jsp",
				data:{enumNo:"106013",flag:"checkUserUnique",mem_no:mem_no},
				success:function(result){
					if($.trim(result)=="0"){
						jrSuccess("恭喜，此用户名尚未使用！");
					}else{
						jrWarn("抱歉，此用户名已存在，请更换！");
					}
				}
			});
	}

	function doSub(){
		var rs = Validator.Validate(document.getElementById("theform"),1);
		if(rs){
			var mem_no=$.trim($("#zd_mem_no").val());
			$.ajax({
				type:"post",
				url:"/backend/action/ajax_r.jsp",
				data:{enumNo:"106013",flag:"checkUserUnique",mem_no:mem_no},
				success:function(result){
					if($.trim(result)=="0" || "<%=id%>"!=""){
						if($("#zd_password").length>0 && "<%=CommonString.getFormatPara(model.get("password"))%>"!=$("#zd_password").val()){ //判断密码框是否存在（编辑信息是不会出现密码框）
							$("#zd_password_bak").val($.trim($("#zd_password").val())); //将密码复制的备份密码字段
						}
						jQuery("#theform").ajaxSubmit({
							type : "POST",
							async : false ,
							success : function(data) {
								var rs = parseInt(jQuery.trim(data), 10);
								if (rs > 0 ) {
									jrSuccess("保存成功！");
									<%
									if("".equals(id)){
										%>
									window.location.reload();
										<%
									}
									%>
								}
							}
						});
					}else{
						jrWarn("抱歉，此用户名已存在，请更换！");
					}
				}
			});
		}
	}
</script>
<%
	}catch(Exception e){
		e.printStackTrace();
	}finally{
		DBHelper.freeConnection(connection);
	}
%>